package com.supsi.segretaria.server;

/**
 * Rappresenta un singolo messaggio e esporre i metodi per ottenere i valori dei campi
 * User: ognjen
 * Date: 06.05.12
 */
public class Message {
    private int messageId;
    private String userFrom;
    private String userTo;
    private String date;
    private String message;
    private Boolean unread;

    public Message(int msgId, String userFrom, String userTo, String message, String date, Boolean unread) {
        this.messageId = msgId;
        this.userFrom = userFrom;
        this.userTo = userTo;
        this.date = date;
        this.message = message;
        this.unread = unread;
    }

    public String getUserFrom() {
        return userFrom;
    }

    public String getUserTo() {
        return userTo;
    }

    public String getDate() {
        return date;
    }

    public String getMessage() {
        return message;
    }

    public Boolean isUnread() {
        return unread;
    }

    public int getMessageId() {
        return messageId;
    }

    public String toString() {
        return "Id : " + String.valueOf(messageId) + "  From: " + userFrom + "  to: " + userTo + "   data: " + date + "  msg: " + message + " read: " + String.valueOf(unread);
    }

    public void makeMessageRead() {
        unread = false;
    }

}
